package app.netmorphgui.tabs;

import java.util.List;
import java.util.Map;

import javax.swing.JPanel;
import netmorph.model.ConfigFile;


public abstract class AbstractTab extends JPanel implements IParameterTab {
	
	JMapTable table = new JMapTable();
 	
	@Override
	public Map<String, String> getParameters() {
		return table.data;
	}
	
	@Override
	public List<String> getKeyList() {
		return table.keyList;
	}
	
	@Override
	public void clearWarnings() {
		table.highlightList.clear();
		table.highlightTooltip.clear();
	}
	
	@Override
	public void markWarning(String key) {
		if (table.keyList.contains(key)) {
			table.highlightList.add(key);
			table.highlightTooltip.put(key, "Netmorph warning: Unused command " + key);
		}
	}

	public abstract void load(ConfigFile cfg);
}
